<!DOCTYPE html>
<html>

<include file="./Application/Admin/View/common/css-js.html"/>
<script src="/Public/layer/layer.js"></script>
<script src="/Public/laydate/laydate.js"></script>
<body class="gray-bg">
<div style="padding-left:1%">
    <br>
    <div style="border:1px solid #CCCCCC;"></div>
</div>


<form method="post" class="form"  action="/index.php/admin/index/bonus_search">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="btn-group btn-group-sm" style="float:left;">
            <button class="btn btn-default btn-sm" type="button" data-toggle="refresh"><a href="/index.php/admin/index/bonuscollect"><i class="fa fa-refresh"></i></a></button>
        </div>
        <div style="float:left">
            <select onchange="selectChange(this.options[this.selectedIndex].text)" id="select" onchange="selectChange()" name="select" style="width:100px;height:30px;padding:0 5px;">
            <option value="105">紫薇阁五店</option>
            <option value="107">紫薇阁七店</option>
            <option value="109">紫薇阁印象店</option>
            <option value="111">紫薇阁南坊店</option>
            <option value="113">紫薇阁罗庄店</option>
            <input type="hidden" id="select_content" name="select_name">
            </select>
            <div style="float:right">
                <span style="margin-left: 20px;">消费日期：</span>
                <input type="text" id="date" class="mdates"  value="{$Think.session.date}" style="width:300px;height:30Px;" placeholder="输入开始日期">
                <input type="hidden" id="dates" name="date" value="">
                <span>到</span>
                <input type="text" id="date1" class="mdates"  value="{$Think.session.date1}" style="width:300px;height:30Px;" placeholder="输入结束日期">
                <input type="hidden" id="dates1" name="date1" value="">
                <span>
                    <button class="btn btn-sm btn-primary" type="submit" id="search"> 搜索</button>
                </span>
            </div>
        </div>
    </div>

</form>

<div class="row"><div class="wrapper wrapper-content animated fadeInRight">
    <div class="col-sm-12">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>明细列表</h5>
                <!--<button type="button" id="exportExcel" onclick="method5('Population-list-1')">导出Excel</button>-->
                <if condition="$list_wages">
                <form action="/index.php/admin/excel/excel_out" enctype="multipart/form-data" method="post" style="display: block; float: right">
                    <input type="submit" value="导出">
                </form>
                </if>

            </div>
            <!--<div class="ibox-content">-->
            <div class="table-responsive">
                <table id="Population-list-1" class="table table-striped table-bordered"
                       data-name="cool-table">
                    <thead>
                    <tr>
                        <th>员工编号</th>
                        <th>所在门店编号</th>
                        <th>所在门店</th>
                        <th>员工手机号</th>
                        <th>提成金额</th>
                        <th>提成笔数</th>
                        <th>工资合计</th>
                    </tr>
                    </thead>
                    <tbody >
                    <volist name="list_wages" id="vo">
                        <tr>
                            <!--<td>{$vo.id}</td>-->
                            <td>{$vo.bind_id}</td>
                            <td>{$vo.bind_did}</td>
                            <td>{$vo.bind_name}</td>
                            <!--<td>{$vo.agent_id}</td>-->
                            <td>{$vo.tel}</td>
                            <td>{$vo.zmoney}</td>
                            <td>{$vo.count}</td>
                            <td>{$vo.wages}</td>
                            <!--<td><a href="/index.php/admin/index/edituser?id={$vo.id}"><i class="fa fa-check text-navy"></i> 修改</a>-->
                                <!--<a href="/index.php/admin/index/deluser?id={$vo.id}">  删除</a>-->
                            <!--</td>-->
                        </tr>
                    </volist  >
                    </tbody>
                    <tfoot>
                    <td colspan="20" style="text-align: center;font-size: 15px">
                        {$page}
                        <!-- <div class="green-black"><{$page}><div/> -->
                    </td>
                    </tfoot>
                </table>
                <div style="float: right;color:red;">
                    <if condition="$zmoneys">
                    <span>提成金额总计：{$zmoneys}元</span>
                    </if>
                </div>
            </div>
        </div>
    </div>
</div>
</div>

<script>
    $(document).ready(function() {

        $('.footable').footable();

    });
    function selectChange(select)
    {
        document.getElementById("select_content").value=select;
    }
    function searchuser()
    {
        var select = document.getElementById("select");
        var index = select.selectedIndex;
        var value = select.options[index].value;
        if(value=="")
        {
            document.getElementById("search").disabled="ture";
        }
    }
</script>

<script>

    $(".form").submit(function(e){
        $('#dates').val($('#date').val());
        var dates = $('#dates').val();
        $('#dates1').val($('#date1').val());
        var dates1 = $('#dates1').val();
        if(dates>dates1){
            layer.alert('开始日期不能大于结束日期');
            return false;
        }else if(!dates || !dates1){
            layer.alert('日期不能为空')
            return false;
        }
    });

    //常规用法
    laydate.render({
        elem: '#date'
        ,type:'date'
    });
    //国际版
    laydate.render({
        elem: '#date1'
        , type:'date'
    });

</script>

<script type="text/javascript" language="javascript">
    // 使用outerHTML属性获取整个table元素的HTML代码（包括<table>标签），然后包装成一个完整的HTML文档，设置charset为urf-8以防止中文乱码
    var html = "<html><head><meta charset='utf-8' /></head><body>" + document.getElementsByTagName("table")[0].outerHTML + "</body></html>";
    // 实例化一个Blob对象，其构造函数的第一个参数是包含文件内容的数组，第二个参数是包含文件类型属性的对象
    var blob = new Blob([html], { type: "application/vnd.ms-excel" });
    var a = document.getElementById("download");
    // 利用URL.createObjectURL()方法为a元素生成blob URL
    a.href = URL.createObjectURL(blob);
    a.download = "用户列表.xls";


</script>

</body>

</html>
